import string
def kaisa(s,k):
    lower = string.ascii_lowercase
    upper = string.ascii_uppercase
    before = string.ascii_letters
    after = lower[k:]+lower[:k]+upper[k:]+upper[:k]
    table= ''.maketrans(before,after)
    return s.translate(table)
s=input("请输入字符串:")
k=eval(input("请输入转移个数:"))
t=kaisa(s,k)
print(t)